# encoding: utf-8
"""
author: JingYang
Created on Mon Sep  7 13:43:46 2020
"""
import time
from functools import wraps


def fn_timer(function):
    @wraps(function)
    def function_timer(*args, **kwargs):
        t0 = time.time()
        result = function(*args, **kwargs)
        t1 = time.time()
        print("{} 函数运行总耗时: {:.2f} 秒".format(function.__name__, t1-t0))
        return result
    return function_timer
